package com.cq.hd.order.api.excel;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.cq.hd.common.enums.biz.OrderStateEnum;
import com.cq.hd.common.enums.biz.SubOrderStateEnum;
import com.cq.hd.common.utils.LocalDateUtil;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

public class GroupOrderSheet implements Serializable {

    @ExcelProperty(value = "订单号", index = 0)
    @ColumnWidth(20)
    @ApiModelProperty(value = "订单号")
    private String orderNo;

    @ExcelProperty(value = "活动标题", index = 1)
    @ColumnWidth(20)
    @ApiModelProperty(value = "活动标题")
    private String activeTitle;

    @ExcelProperty(value = "下单数量", index = 2)
    @ColumnWidth(20)
    @ApiModelProperty(value = "下单数量")
    private Integer orderNum;

    @ExcelProperty(value = "子订单号", index = 3)
    @ColumnWidth(20)
    @ApiModelProperty(value = "子订单号")
    private String subOrderNo;

    @ExcelProperty(value = "商品名称", index = 4)
    @ColumnWidth(20)
    @ApiModelProperty(value = "商品名称")
    private String goodsName;

    @ExcelProperty(value = "商品价格", index = 5)
    @ColumnWidth(20)
    @ApiModelProperty(value = "商品价格")
    private String goodsPrice;

    @ExcelProperty(value = "分账本金", index = 6)
    @ColumnWidth(20)
    @ApiModelProperty(value = "商户订单本金(按比例分配的用户支付的订单款)")
    private String merchantAmt;

    @ExcelProperty(value = "分账补贴", index = 7)
    @ColumnWidth(20)
    @ApiModelProperty(value = "总补贴金额")
    private String totalSubsidyAmt;

    @ExcelProperty(value = "子订单状态", index = 8)
    @ColumnWidth(20)
    @ApiModelProperty(value = "订单状态(0-待支付，1-待核销，2-已核销，3-已取消，4-已过期)")
    private String subOrderState;

    @ExcelProperty(value = "所属商户", index = 9)
    @ColumnWidth(20)
    @ApiModelProperty(value = "所属商户")
    private String merchantName;

    @ExcelProperty(value = "核销时间", index = 10)
    @ColumnWidth(20)
    @ApiModelProperty(value = "订单核销时间")
    private String verifyTime;

    @ExcelProperty(value = "下单人昵称", index = 11)
    @ColumnWidth(20)
    @ApiModelProperty(value = "下单人昵称")
    private String orderNickName;

    @ExcelProperty(value = "下单人手机号", index = 12)
    @ColumnWidth(20)
    @ApiModelProperty(value = "下单人手机号")
    private String orderMobile;

    @ExcelProperty(value = "订单总额", index = 13)
    @ColumnWidth(20)
    @ApiModelProperty(value = "订单总额")
    private String orderPrice;

    @ExcelProperty(value = "优惠金额", index = 14)
    @ColumnWidth(20)
    @ApiModelProperty(value = "优惠金额")
    private String discountAmt;

    @ExcelProperty(value = "红包金额", index = 15)
    @ColumnWidth(20)
    @ApiModelProperty(value = "红包金额")
    private String redPacketAmt;

    @ExcelProperty(value = "实付金额", index = 16)
    @ColumnWidth(20)
    @ApiModelProperty(value = "实付金额")
    private String payPrice;

    @ExcelProperty(value = "商品本金合计", index = 17)
    @ColumnWidth(20)
    @ApiModelProperty(value = "商品本金合计")
    private String totalMerchantAmt;

    @ExcelProperty(value = "商品补贴合计", index = 18)
    @ColumnWidth(20)
    @ApiModelProperty(value = "商品补贴合计")
    private String subsidyAmt;

    @ExcelProperty(value = "经纪人昵称", index = 19)
    @ColumnWidth(20)
    @ApiModelProperty(value = "经纪人昵称")
    private String agentNickName;

    @ExcelProperty(value = "经纪人手机号", index = 20)
    @ColumnWidth(20)
    @ApiModelProperty(value = "经纪人手机号")
    private String agentMobile;

    @ExcelProperty(value = "推广权益", index = 21)
    @ColumnWidth(20)
    @ApiModelProperty(value = "推广权益")
    private String promotionEquity;

    @ExcelProperty(value = "订单总补贴", index = 22)
    @ColumnWidth(20)
    @ApiModelProperty(value = "订单总补贴")
    private String totalOrderSubsidy;

    @ExcelProperty(value = "订单状态", index = 23)
    @ColumnWidth(20)
    @ApiModelProperty(value = "订单状态(1-待支付,2-待核销,3-核销中,4-已取消,5-已完成,6-已关闭,7-已核销)")
    private String orderState;

    @ExcelProperty(value = "下单时间", index = 24)
    @ColumnWidth(20)
    @ApiModelProperty(value = "下单时间")
    private String orderTime;

    @ExcelProperty(value = "支付时间", index = 25)
    @ColumnWidth(20)
    @ApiModelProperty(value = "支付时间")
    private String payTime;

    @ExcelProperty(value = "订单完成时间", index = 26)
    @ColumnWidth(20)
    @ApiModelProperty(value = "订单完成时间")
    private String finishTime;

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getActiveTitle() {
        return activeTitle;
    }

    public void setActiveTitle(String activeTitle) {
        this.activeTitle = activeTitle;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public String getSubOrderNo() {
        return subOrderNo;
    }

    public void setSubOrderNo(String subOrderNo) {
        this.subOrderNo = subOrderNo;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsPrice() {
        return goodsPrice;
    }

    public void setGoodsPrice(BigDecimal getGoodsPrice) {
        if (getGoodsPrice != null) {
            this.goodsPrice = getGoodsPrice.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
        }
    }

    public String getMerchantAmt() {
        return merchantAmt;
    }

    public void setMerchantAmt(BigDecimal getMerchantAmt) {
        if (getMerchantAmt != null) {
            this.merchantAmt = getMerchantAmt.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
        }
    }

    public String getTotalSubsidyAmt() {
        return totalSubsidyAmt;
    }

    public void setTotalSubsidyAmt(BigDecimal getTotalSubsidyAmt) {
        if (getTotalSubsidyAmt != null) {
            this.totalSubsidyAmt = getTotalSubsidyAmt.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
        }
    }

    public String getSubOrderState() {
        return subOrderState;
    }

    public void setSubOrderState(Integer subOrderState) {
        SubOrderStateEnum subOrderStateEnum = SubOrderStateEnum.typeOf(subOrderState);
        if (subOrderStateEnum != null) {
            this.subOrderState = subOrderStateEnum.getName();
        }
    }

    public String getMerchantName() {
        return merchantName;
    }

    public void setMerchantName(String merchantName) {
        this.merchantName = merchantName;
    }

    public String getVerifyTime() {
        return verifyTime;
    }

    public void setVerifyTime(LocalDateTime getVerifyTime) {
        if (getVerifyTime != null) {
            this.verifyTime = LocalDateUtil.toLocalDateTimeToString(getVerifyTime, "yyyy.MM.dd HH:mm:ss");
        }
    }

    public String getOrderNickName() {
        return orderNickName;
    }

    public void setOrderNickName(String orderNickName) {
        this.orderNickName = orderNickName;
    }

    public String getOrderMobile() {
        return orderMobile;
    }

    public void setOrderMobile(String orderMobile) {
        this.orderMobile = orderMobile;
    }

    public String getOrderPrice() {
        return orderPrice;
    }

    public void setOrderPrice(BigDecimal getOrderPrice) {
        if (getOrderPrice != null) {
            this.orderPrice = getOrderPrice.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
        }
    }

    public String getDiscountAmt() {
        return discountAmt;
    }

    public void setDiscountAmt(BigDecimal getDiscountAmt) {
        if (getDiscountAmt != null) {
            this.discountAmt = getDiscountAmt.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
        }
    }

    public String getRedPacketAmt() {
        return redPacketAmt;
    }

    public void setRedPacketAmt(BigDecimal getRedPacketAmt) {
        if (getRedPacketAmt != null) {
            this.redPacketAmt = getRedPacketAmt.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
        }
    }

    public String getPayPrice() {
        return payPrice;
    }

    public void setPayPrice(BigDecimal getPayPrice) {
        if (getPayPrice != null) {
            this.payPrice = getPayPrice.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
        }
    }

    public String getTotalMerchantAmt() {
        return totalMerchantAmt;
    }

    public void setTotalMerchantAmt(BigDecimal getTotalMerchantAmt) {
        if (getTotalMerchantAmt != null) {
            this.totalMerchantAmt = getTotalMerchantAmt.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
        }
    }

    public String getSubsidyAmt() {
        return subsidyAmt;
    }

    public void setSubsidyAmt(BigDecimal getSubsidyAmt) {
        if (getSubsidyAmt != null) {
            this.subsidyAmt = getSubsidyAmt.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
        }
    }

    public String getAgentNickName() {
        return agentNickName;
    }

    public void setAgentNickName(String agentNickName) {
        this.agentNickName = agentNickName;
    }

    public String getAgentMobile() {
        return agentMobile;
    }

    public void setAgentMobile(String agentMobile) {
        this.agentMobile = agentMobile;
    }

    public String getPromotionEquity() {
        return promotionEquity;
    }

    public void setPromotionEquity(String promotionEquity) {
        this.promotionEquity = promotionEquity;
    }

    public String getTotalOrderSubsidy() {
        return totalOrderSubsidy;
    }

    public void setTotalOrderSubsidy(BigDecimal getTotalOrderSubsidy) {
        if (getTotalOrderSubsidy != null) {
            this.totalOrderSubsidy = getTotalOrderSubsidy.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
        }
    }

    public String getOrderState() {
        return orderState;
    }

    public void setOrderState(Integer orderState) {
        OrderStateEnum orderStateEnum = OrderStateEnum.typeOf(orderState);
        if (orderStateEnum != null) {
            this.orderState = orderStateEnum.getName();
        }
    }

    public String getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(LocalDateTime getOrderTime) {
        if (getOrderTime != null) {
            this.orderTime = LocalDateUtil.toLocalDateTimeToString(getOrderTime, "yyyy.MM.dd HH:mm:ss");
        }
    }

    public String getPayTime() {
        return payTime;
    }

    public void setPayTime(LocalDateTime getPayTime) {
        if (getPayTime != null) {
            this.payTime = LocalDateUtil.toLocalDateTimeToString(getPayTime, "yyyy.MM.dd HH:mm:ss");
        }
    }

    public String getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(LocalDateTime getFinishTime) {
        if (getFinishTime != null) {
            this.finishTime = LocalDateUtil.toLocalDateTimeToString(getFinishTime, "yyyy.MM.dd HH:mm:ss");
        }
    }
}
